import http from '@/utils/http'

interface BasicParams {
  dtoName: string // 参考后端接口文档
  queryId: string // 参考confluence上的页面需求SQL标识
  version: string // 参考confluence上的页面需求SQL版本号
  menuName: string // 菜单的标识，与菜单管理配置保持一致
  usage: string // 接口后缀，标识用途
  shopId: string // shopId
}
/*
  eg./ims-tworkgz-service/viewCstHistory/getCstHistory
*/

/** 获取 getEqpList 信息 */
export function getEqpList(data: BasicParams, method: any = 'POST'): Promise<any> {
  const { menuName, usage, shopId } = data
  return http.request({
    url: `/ims-tworkgz-service/${menuName}/${usage}`,
    method,
    params: {
      shopId
    }
  })
}

/** 获取 glassExport 信息 */
export function glassExport(data: BasicParams): Promise<any> {
  return http.request({
    url: '/ims-tworkgz-service/releaseGlass/glassExport',
    method: 'POST',
    responseType: 'blob',
    data
  })
}
